package net.huashitong.synthetical.AddressBook.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.core.service.StringService;
import com.sirdc.modules.sys.base.StringPKService;
import net.huashitong.synthetical.AddressBook.dao.AddressBookDao;
import net.huashitong.synthetical.AddressBook.entity.AddressBook;
import net.huashitong.synthetical.AddressBook.filter.BookFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressBookService extends StringPKService<AddressBook> {
    @Autowired
    private AddressBookDao dao;

    @Override
    protected BaseDao<AddressBook, String> getDao() {
        return dao;
    }

    /**
     * 查询通讯录所有的单位
     * @param filter
     * @return
     */
    public List<AddressBook> getBooks(BookFilter filter)
    {
        return dao.getBooks(filter);
    }

    public AddressBook getBookObj(BookFilter filter)
    {
        return dao.getBookObj(filter);
    }

}
